package a.f.h.c;

import a.c.ab;
import a.c.m;
import a.c.q;
import a.c.x;
import a.f.h.b.f;
import a.i.db;
import a.i.t;

public class e
  implements g
{
  public static boolean a;
  
  public void a(f paramf, l paraml1, l paraml2)
  {
    a.i.n.a(this, 3, "Flow Compaction");
    a(paraml1);
    a(paraml2);
  }
  
  public void a(l paraml)
  {
    boolean bool = d.o;
    int m = d.n;
    q localq = paraml.m();
    int[] arrayOfInt = new int[localq.k()];
    a.c.n localn = localq.C();
    ab localab = new ab();
    int i = 0;
    m localm = localq.w();
    while (localm.e())
    {
      localObject1 = localm.a();
      localn.a(localObject1, (int)paraml.c((a.c.d)localObject1));
      int k = paraml.d((a.c.d)localObject1);
      arrayOfInt[((a.c.d)localObject1).e().f()] -= k;
      arrayOfInt[((a.c.d)localObject1).f().f()] += k;
      i += k;
      localm.f();
      if (bool) {
        break label200;
      }
      if (m != 0) {
        break label196;
      }
      if (m != 0)
      {
        if (bool) {
          break label200;
        }
        if (!bool) {}
        q.n = !q.n;
      }
    }
    a.i.n.a(this, "Total weight: " + i);
    label196:
    label200:
    int j = i + 1;
    Object localObject1 = localq.v();
    do
    {
      do
      {
        if (!((a.c.w)localObject1).e()) {
          break;
        }
        localObject2 = ((a.c.w)localObject1).d();
        arrayOfInt[((a.c.e)localObject2).f()] += j * ((a.c.e)localObject2).e() - j * ((a.c.e)localObject2).d();
        ((a.c.w)localObject1).f();
        if (bool) {
          break label294;
        }
        if (m != 0) {
          break label287;
        }
      } while (m == 0);
    } while (bool);
    localObject1 = localq.v();
    label287:
    label294:
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      localObject2 = paraml.b(((a.c.w)localObject1).d());
      localObject3 = paraml.a((d)localObject2);
      if (((bool) || (localObject3 != null)) && (((k)localObject3).a() == localObject2))
      {
        localObject4 = localq.a(((k)localObject3).b().b(), ((k)localObject3).a().b());
        localn.a(localObject4, (int)((k)localObject3).c());
        localab.add(localObject4);
      }
      ((a.c.w)localObject1).f();
    } while (m == 0);
    localObject1 = new t()
    {
      private final int val$MAX_CAP;
      
      public int getInt(Object paramAnonymousObject)
      {
        return this.val$MAX_CAP;
      }
    };
    Object localObject2 = new t()
    {
      public int getInt(Object paramAnonymousObject)
      {
        return 0;
      }
    };
    Object localObject3 = db.a(arrayOfInt);
    Object localObject4 = localq.C();
    x localx = localq.B();
    a.a.w.a(localq, (a.c.k)localObject2, (a.c.k)localObject1, localn, (a.c.k)localObject3, (a.c.n)localObject4, localx);
    Object localObject5 = localq.v();
    do
    {
      if (!((a.c.w)localObject5).e()) {
        break;
      }
      d locald = paraml.b(((a.c.w)localObject5).d());
      locald.a(localx.getInt(((a.c.w)localObject5).d()));
      ((a.c.w)localObject5).f();
    } while (m == 0);
    localObject5 = localab.l();
    if (((m)localObject5).e()) {}
    do
    {
      localq.a(((m)localObject5).a());
      ((m)localObject5).f();
      if ((!bool) && (m != 0)) {
        break label588;
      }
      if (m == 0) {
        break;
      }
      localq.a(localn);
      localq.a((a.c.n)localObject4);
    } while (bool);
    localq.a(localx);
    label588:
    if (bool) {
      q.o = !q.o;
    }
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.h.c.e
 * JD-Core Version:    0.7.0.1
 */